﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace A2DFramework.InstanceService.Configuration
{
    public static class InstanceConfiguration
    {
        public static int DefaultMaxInstanceCount { get; set; }

        static InstanceConfiguration()
        {
            Load();
        }

        internal static void Load()
        {
            XElement root = XElement.Load(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "A2D.config"));

            root = root.Element("InstanceConfig");
            if (root == null)
                return;

            DefaultMaxInstanceCount = int.Parse(root.Element("DefaultMaxInstanceCount").Value);
        }
    }
}
